package myPack.GMAO.Entity;

import java.io.Serializable;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
@Inheritance (strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="Personel_type",discriminatorType=DiscriminatorType.STRING,length=20)
public class User  implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	@Id @GeneratedValue
	private int id;
    private String log;
    private String pass;
    
    @OneToOne @JoinColumn(name="mat")
	private Acteur acteur;
    
    @OneToOne @JoinColumn(name="idP")
    private Privilege privilege;
    
    public User () {
    }
    

	public User(int id, String log, String pass, Acteur acteur,
			Privilege privilege) {
		super();
		this.id = id;
		this.log = log;
		this.pass = pass;
		this.acteur = acteur;
		this.privilege = privilege;
	}


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public Acteur getActeur() {
		return acteur;
	}

	public void setActeur(Acteur acteur) {
		this.acteur = acteur;
	}

	public Privilege getPrivilege() {
		return privilege;
	}

	public void setPrivilege(Privilege privilege) {
		this.privilege = privilege;
	}
	
}